//FULLY CONVERTED...UNTESTED

using System.Collections.Generic;
using UnityEngine;

public class Card : ScriptableObject 
{
	private string name, activeDescription, passiveDescription;
	private int egocost, priority;
	private List<EffectActive> actives;
	private List<EffectPassive> passives;
	private string type;
	//private Image art;
	
	
	public Card(string name, string activeDescription, string passiveDescription, int egocost, int priority, string type) : 
			this(name,activeDescription,passiveDescription,egocost,priority,type,null,null) {}
	
	public Card(string name, string activeDescription, string passiveDescription, int egocost, int priority, string type, List<EffectActive> actives, List<EffectPassive> passives)
	{
		this.name = name;
		this.activeDescription = activeDescription;
		this.passiveDescription = passiveDescription;
		this.egocost = egocost;
		this.priority = priority;
		this.type = type;
		this.actives = actives;
		this.passives = passives;
	}
	
	public string getType(){
		return type;
	}
	
	public string getName()
	{
		return name;
	}
	
	public string getActiveDescription()
	{
		return activeDescription;
	}
	
	public string getPassiveDescription()
	{
		return passiveDescription;
	}
	
	public int getCost()
	{
		return egocost;
	}
	
	/*
	public Color getColor()
	{
		if (type.equals("Logic"))
		{
			return new Color(128,128,255);
		}
		else if (type.equals("Ethics"))
		{
			return new Color(255,255,128);
		}
		else if (type.equals("Passion"))
		{
			return new Color(255,128,128);
		}
		else if (type.equals("Deception"))
		{
			return new Color(128,128,128);
		}
		else
		{
			return Color.white;
		}
	}
	*/
	
	public string tostring()
	{
		return name + ": cost=" + (int)(egocost * this.actives[0].user.egoCostRate);
	}
	
	public int getPriority(){
		return priority;
	}
	
	public List<EffectActive> getActives(){
		return actives;
	}
	
	public List<EffectPassive> getPassives(){
		return passives;
	}

	public void remake(Card card) {
		this.name = card.name;
		this.activeDescription = card.activeDescription;
		this.passiveDescription = card.passiveDescription;
		this.actives = card.actives;
		this.passives = card.passives;
		this.egocost = card.egocost;
		this.priority = card.priority;
		this.type = card.type;
		
	}
	
	
	public Card duplicate(){
		return new Card(this.name, this.activeDescription, this.passiveDescription, this.egocost, this.priority, this.type, this.actives, this.passives);
	}
}
